import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path:"/",
    name:"home",
    redirect:"/home",
  },
  {
    path: '/home',
    name: 'index',
    // redirect:"/home", // 重定向
    component: ()=>import('../views/index'),
  },
  {
    path: "/home/login",
    name:"login",
    component:()=>import("../views/Login")
  },
  {
    path: "/home/enroll",
    name:"enroll",
    component:()=>import("../views/enroll")
  },
  {
    path: "/home/forget",
    name: "forget_password",
    component:()=>import('../views/forget')
  }
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
